# -*- coding: utf-8 -*-

__author__ = 'Perry'
from utils import BasePage
from selenium.webdriver.common.by import By
from appium.webdriver.common.touch_action import TouchAction

class Message(BasePage.Base):

	icon_loc = (By.ID, "cc.vv.btong:id/include_im_search")
	avatar = (By.NAME, "杨超")
	delete = (By.NAME, "删除")

	#清除消息列表
	def clearnMessageList(self):
		lists = self.find_elements(self.avatar)

		for index in range(len(lists)):
			TouchAction(self.driver).long_press(lists[0]).perform()
			lists[index].click()

	def click(self):
		self.find_element(self.btn_loc).click()